@extends('layout.admin')

@section('content')
<style>
	.pagelist{
		margin-left:200px;
	}
	.pagelist li a,span{
		width:40px;
		height:40px;
	}
</style>
<!-- 	<div class="clearfix"></div> -->
	
  
		<div class="col-md-12" >
	
			<div class="panel-head"><strong class="icon-reorder"> 用户列表</strong></div>
			<form action="/admin/user/list" method='get' enctype='multipart/form-data'>
				<div id="DataTables_Table_0_length" class="dataTables_length">
					<label>显示 
					<select type='text' name="num" aria-controls="DataTables_Table_0" style='width:50px;height:30px'>
						<option value="5" @if($request->input('num') == 5) selected @endif>5</option>
						<option value="10" @if($request->input('num') == 10) selected @endif>10</option>
						<option value="15" @if($request->input('num') == 15) selected @endif>15</option>
						<option value="20" @if($request->input('num') == 20) selected @endif>20</option>
						</select> 页
					</label>
					<label style='margin-left:700px'>搜索: 
						<input aria-controls="DataTables_Table_0" type="text" name='keyword' value='{{$request->input("keyword")}}'>
						
						<button class="btn btn-small"><i class="icon-search"></i></button>
					</label>	
				
				</div>
			</form>	
				<table class="table table-hover text-center">

					
				    <tbody>
				    <tr>
				      <th width="5%">ID</th>
				      <th width="15%">用户名</th>
				      <th width="10%">邮箱</th>
				      <th width="10%">头像</th>
				      
				      <th width="15%">操作</th>

				    </tr>
				@foreach($users as $k=>$v)
				   	<tr class="@if($k % 2 == 0) even success @else odd active @endif">
				   		<td>{{$v->id}}</td>
				   		<td>{{$v->username}}</td>
				   		<td>{{$v->email}}</td>
				   		<td><img src="{{$v->profile}}" alt="" height="50px"></td>
				   		<td>
				   			<a href="/admin/user/edit?id={{$v->id}}"><button class='btn btn-info'>修改</button></a>
				   			<a href="/admin/user/delete?id={{$v->id}}"><button class='btn btn-warning'>删除</button></a>

				   		</td>
				   	</tr>
				@endforeach
				  	</tbody>
				</table>
				<div class='pagelist navbar-fixed-bottom'> 
					{!! $users->appends($request->all())->render() !!}
				</div>
				
				
		</div>
	</div>
@endsection